package com.month.security.controller;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {

    @GetMapping("/getOrder01")
    @PreAuthorize("hasAuthority('R1')")
    public String getOrder(){
        return "订单服务-1:需要权限R1";
    }


    @PreAuthorize("hasAuthority('R2')")
    @GetMapping("/getOrder02")
    public String getOrder2(){
        return "订单服务-2:需要权限R2";
    }
}
